<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,html{
            height: 100%;
        }
        .box{
            /* 百分百跟随父盒子的高度 */
            height: 100%;
            width: 1000px;
            background-color: #ff7171;
            /* 版心居中 */
            margin: auto;
            text-align: center;
        }
        .d1{
            height: 500px;
        }
    </style>
</head>
<body>
    <div class="box">
        版心居中练习
        <div class="d1"></div>
    </div>
</body>
</html>